# -*- coding: utf-8 -*-
# @Time : 2022/6/15 上午11:15
# @Author : wyf
# @FileName: selenium拖动.py
# @Email: yunfei.wang@innvote.com
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By

browser = webdriver.Chrome()

url = "http://www.runoob.com/try/try.php?filename=jqueryui-api-droppable"

browser.get(url)
browser.switch_to.frame("iframeResult")  # #### 切换frame (子网页)
dra = browser.find_element(By.ID, "draggable")

dro = browser.find_element(By.ID, "droppable")

actions = ActionChains(browser)
actions.drag_and_drop(dra, dro)
# 执行拖动
actions.perform()



